<template>
  <div :class="{ head: true, bgcolor: bgcolor == 1 ,bg:bg==1}">
    <div>
      <span class="el-icon-arrow-left" v-if="xs == 1" @click="fan">返回</span>
      <p :class="icon" v-if="icon != ''"></p>
    </div>
    <div class="content" v-show="title != ''" :class="{xs:true,fanhui:fh==1,fanhui2:fh==2}">
      <p>{{ title }}</p>
    </div>
    <div @click="chuan" v-if="xs == ''">
      <p>完成</p>
    </div>
  </div>
</template>
<script>
export default {
  name: "Head",
  props: ["title", "xs", "icon", "bgcolor","fh",'bg',"school"],
  //props:["接收页面传来的值 如:","school"]
  //接收的值可直接使用,如:this.school
  
  data() {
    return {};
  },
  methods:{
    fan(){
      this.$router.go(-1);
      //this.$router.back(1);
    }
    ,chuan(){
      if(this.school.length ==0){
        return alert("未选择图片")
      }else{
        //this.$router.push()想向某个页面跳转    ({name:"跳转页面name",params:{命名:数据}})
        //params{} 可以向页面传值
        this.$router.push({name:"Fabu2",params:{data:this.school}});
        
      }
    }
  }
};
</script>
<style lang="scss" scoped>
.head {
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  > div:nth-of-type(1) {
    width: 90px;
    margin-left: 3px;
    > span:nth-of-type(1) {
      font-size: 22px;
      opacity: 0.7;
      cursor: pointer;
    }
    > p {
      font-size: 30px;
      cursor: pointer;
    }
  }
  > div:nth-of-type(2) {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
    font-size: 22px;
    > P {
      // margin-right: 10px;
    }
  }
  > div:nth-of-type(3) {
    width: 58px;
    margin-right: 10px;
    >p{
      font-size: 15pt;
      color: gray;
      cursor: pointer;
    }
  }
}
.bg{
  color: white;
}
.bgcolor {
  background-color: white;
}
.fanhui{
  width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
    font-size: 22px;
    > P {
      margin-right:80px;
    }
}
.fanhui2{
  width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
    font-size: 22px;
    > P {
      margin-right:15px;
    }
}
</style>